package com.vpx.server.controller.system;
import com.vpx.server.bean.order.base.BaseIdOrder;
import com.vpx.server.bean.order.system.SysDicTypeOrder;
import com.vpx.server.bean.order.system.SysDicTypePageOrder;
import com.vpx.server.bean.result.system.SysDicTypePageResult;
import com.vpx.server.bean.result.system.SysDicTypeResult;
import com.vpx.server.framework.authority.AuthPoicy;
import com.vpx.server.framework.authority.RequestAuth;
import com.vpx.server.framework.base.ResultMsg;
import com.vpx.server.service.system.SysDicTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author liuks
 * @title: vpx
 * @module: 数据字典类型
 * @description: 数据字典类型接口
 * @date 2021/09/20 17:28
 */
@RestController
@RequestMapping(value = "/api/dicType")
@Api(tags = "数据字典类型")
public class SysDicTypeController {

    @Autowired
    private SysDicTypeService sysDicTypeService;

    @PostMapping("insert")
    @ApiOperation("新增数据字典类型")
    @RequestAuth(poicy = AuthPoicy.LOGIN)
    public ResultMsg insert(@RequestBody SysDicTypeOrder order) {
        return sysDicTypeService.insert(order);
    }

    @DeleteMapping("deleteById")
    @ApiOperation("删除数据字典类型")
    @RequestAuth(poicy = AuthPoicy.LOGIN)
    public ResultMsg deleteById(@RequestBody BaseIdOrder order) {
        return sysDicTypeService.deleteById(order);
    }

    @PutMapping("updateById")
    @ApiOperation("修改数据字典类型")
    @RequestAuth(poicy = AuthPoicy.LOGIN)
    public ResultMsg updateById(@RequestBody SysDicTypeOrder order) {
        return sysDicTypeService.updateById(order);
    }

    @GetMapping("findById")
    @ApiOperation("查询数据字典类型")
    @RequestAuth(poicy = AuthPoicy.LOGIN)
    public ResultMsg<SysDicTypeResult> findById(BaseIdOrder order) {
        return sysDicTypeService.findById(order);
    }

    @GetMapping("pageQuery")
    @ApiOperation("分页查询数据字典类型")
    @RequestAuth(poicy = AuthPoicy.LOGIN)
    public ResultMsg<SysDicTypePageResult> pageQuer(SysDicTypePageOrder order) {
        return sysDicTypeService.pageQuery(order);
    }
}
